package com.learning.dynamic.executor.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;

import java.util.List;

/**
 * @author Wang Xu
 * @date 2023/11/7
 */
@ConfigurationProperties(prefix = "dynamic.executor")
public class DynamicProperties {
    private List<DynamicExecutorProperties> dynamicExecutorPropertiesList;

    public List<DynamicExecutorProperties> getDynamicExecutorPropertiesList() {
        return dynamicExecutorPropertiesList;
    }

    public void setDynamicExecutorPropertiesList(List<DynamicExecutorProperties> dynamicExecutorPropertiesList) {
        this.dynamicExecutorPropertiesList = dynamicExecutorPropertiesList;
    }

    public static class DynamicExecutorProperties {
        /** 执行器名称 */
        private String poolName;

        /** 核心线程数 */
        private Integer corePoolSize;

        /** 最大线程数 */
        private Integer maximumPoolSize;

        public String getPoolName() {
            return poolName;
        }

        public void setPoolName(String poolName) {
            this.poolName = poolName;
        }

        public Integer getCorePoolSize() {
            return corePoolSize;
        }

        public void setCorePoolSize(Integer corePoolSize) {
            this.corePoolSize = corePoolSize;
        }

        public Integer getMaximumPoolSize() {
            return maximumPoolSize;
        }

        public void setMaximumPoolSize(Integer maximumPoolSize) {
            this.maximumPoolSize = maximumPoolSize;
        }
    }
}